package com.example.autocode.strategy;

import com.example.autocode.entity.AutoCodePart;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @Author zhangxin
 * @create 2021/12/23 16:49
 */
@Component
@Order(2)
public class PartType02Handle implements PartTypeTemplate {
    @Override
    public String partHandle(AutoCodePart autoCodePart) {
        String formatDate = autoCodePart.getDatetimeFormat();
        return DateTimeFormatter.ofPattern(formatDate).format(LocalDateTime.now());
    }
}
